package Work5;

import java.util.Scanner;

public class Main3 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		double[] array = new double[n];
		for (int i = 0; i < array.length; i++) {
			array[i] = in.nextDouble();
		}
		ArrayUtils arr = new ArrayUtils();
		System.out.println(arr.findMinMax(array).toString());
		System.out.println(ArrayUtils.PairResult.class);

	}

}

class ArrayUtils {

	PairResult findMinMax(double[] values) {
		PairResult result = new PairResult();
		if (values == null) {
			return result;
		}
		double min = values[0], max = values[0];

		for (int i = 0; i < values.length; i++) {
			if (values[i] > max)
				max = values[i];
			if (values[i] < min)
				min = values[i];
		}
		result.setMax(max);
		result.setMin(min);

		return result;

	}

	static class PairResult {
		private double min;
		private double max;

		public double getMin() {
			return min;
		}

		public void setMin(double min) {
			this.min = min;
		}

		public double getMax() {
			return max;
		}

		public void setMax(double max) {
			this.max = max;
		}

		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}

	}
}